import moment from 'moment'
export default {
  // 获取当前周
  getWeek(state) {
    const startDate =  moment('2022-2-21').format('YYYY-MM-DD');
    const endDate = moment(new Date()).format('YYYY-MM-DD');
    const Spacing = moment(endDate).diff(startDate, 'day');
    // 求出Week
    let Week = Spacing / 7;
    console.log(Week)
    state.Week = Number(Week) + 1;
  },
  getCourse( state, List) {
    if (typeof List === 'string') {
      console.log(List)
    }else {
      state.courseList = List
    }
  }
}